home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / BBS / LL_100.ZIP / LOGLIST.DOC < prev    next >
Encoding:
Text File  |  1996-01-21  |  20.0 KB  |  555 lines

  1.  
  2.                             TBBS Log-Lister
  3.  
  4.                              by Paul Blitz
  5.  
  6.                              Version 1.00
  7.                                20 Jan 96
  8.  
  9.  
  10. Introduction
  11. ============
  12.  
  13. Last year, I wrote some simple programs to list out certain (fixed) fields
  14. from the userlog to a text file. Michael Muller suggested that a more
  15. complete & more flexible program would be useful, especially so that the
  16. output files could be used with TYPE 1 & 2 text listing commands.
  17.  
  18. Log-Lister allows you to create your own customised lists from your TBBS
  19. userlog file. These files list one user's details per line, and may include
  20. colourisation commands (using "%Xnn%" sequences), fixed text, headings,
  21. tabs, as well as the data itself.
  22.  
  23. The "definition" of the output is made in the configuration file: you can
  24. have several of these, and simply call up the one you want to use on the
  25. program's command line.
  26.  
  27. Log-Lister is a DOS program, and would typically be called as part of your
  28. night-time external event, from the relevant batch file (that's YOUR
  29. problem, not mine... <grin>)
  30.  
  31. This version of Log Lister has been written for use with TBBS 2.3.
  32.  
  33.  
  34. Future Versions
  35. ===============
  36.  
  37. I hope that there will be enough interest to make it worthwhile improving
  38. the program further.... if you have any suggestions for improvements to
  39. the program, then let me know (see the end for contact addresses)
  40.  
  41. When you register, your "registration key" will be valid for all future
  42. "non-major" upgrades to the program.
  43.  
  44.  
  45. Running the program
  46. ===================
  47.  
  48. LOGLIST.EXE and your TBBS userlog (USERLOG.BBS) do *not* need to be
  49. together in the same directory, as long as you define a full path to your
  50. userlog. Unless Borland have screwed up the pascal compiler, your userlog
  51. is only ever opened for READING, so your userlog won't be disturbed in any
  52. way.
  53.  
  54. The program calling syntax is:
  55.  
  56.     LOGLIST <config file>
  57.  
  58. If you don't give a config file, then "LOGLIST.CFG", in the current
  59. directory, will be used.
  60.  
  61. The filename may include a full pathname, upto a maximum length of 50
  62. characters.
  63.  
  64. The config file not only contains formatting information, but gives the
  65. paths & filenames for the USERLOG.BBS file, the output text file, and the
  66. log file. This allows you to have multiple configuration files to produce
  67. several output files.
  68.  
  69.  
  70. The program will return one of several error levels when it exits:
  71.  
  72.     0 : Program ran OK
  73.     1 : Error in command line parameters
  74.     2 : Can't find file
  75.     3 : Error in config file
  76.     9 : Control-C / Escape was pressed during program
  77.     99: Internal processing error (eg: out of range value)
  78.  
  79. All errors will also return an error message on the screen (and the log
  80. file), with as much useful information as possible.
  81.  
  82. To help get you going, I've included some demo config files... if *you* do
  83. any good configs, please send them to me, and I'll include them (and then
  84. you could become famous!!)
  85.  
  86.  
  87. How it works
  88. ============
  89.  
  90. The program simply creates a textual list file, which can either be
  91. printed, or can be viewed online by your callers (eg with a TYPE1). The
  92. file contains page headers, and one line of text for each user in your
  93. userlog..... or rather for each user who matches the "restriction criteria"
  94. (see below).
  95.  
  96. You can define a "page length": when you do this, the program will insert a
  97. "%MORE%" at the relevant places. When viewed online, the user will then see
  98. the data a page at a time.
  99.  
  100. The file can have a set of file- and page-header lines, and a set of
  101. page-bottom lines: these are copied from the config file verbatim, so may
  102. contain "real-time" substitution parameters which TBBS will expand for you.
  103.  
  104. The lines of user data are then built up from lines of different types of
  105. data (eg words, substitution parameters and colourisation commands). If the
  106. data contains substitution parameters, then they are replaced by the
  107. relevant data from the userlog records.
  108.  
  109. For example, the set of data might include:
  110.  
  111.   header "A list of names etc"
  112.   header "-------------------"
  113.   %X03%
  114.   %NAME%
  115.   Tab to column 20
  116.   %X95%
  117.   %PHONE%
  118.   Tab to column 35
  119.   %X22%
  120.   %ADDR1%
  121.   a ","
  122.   a space
  123.   %ADDR2%
  124.   a "."
  125.  
  126. (this is NOT actually how the data is defined... see below)
  127.  
  128. This would give a list something like this:
  129.  
  130. A list of names etc
  131. -------------------
  132. Paul Blitz         %X95%441962885696   %X22%25 Woodgreen Road, Winchester.
  133. Phil Becker        %X95%303 699 6565   %X22%15200 E. Girard Ave., Aurora.
  134. .... etc
  135.  
  136. The "file header" gets printed once, at the top of the file. The "page
  137. headers" are printed at the top of the second and subsequent pages (after a
  138. "%MORE%").
  139.  
  140. The way the data is created is defined by the config file (see below). If
  141. you want to create several lists, then you simply create multiple
  142. configuration files, and run LOGLIST multiple times, specifying the
  143. different config files.
  144.  
  145.  
  146.  
  147. Config File format
  148. ==================
  149.  
  150. The config file format is, I hope, fairly straight-forward, and if best
  151. understood by looking at the supplied demo config files.
  152.  
  153. Column 1 of the file defines what that line is:
  154.  
  155.   U or u  - path & filename of your USERLOG.BBS file
  156.   O or o  - path & filename of the output file
  157.   L or l  - path & filename of the log file
  158.   F or f  - a file header line
  159.   P or p  - a page header line
  160.   B or b  - a page bottom line
  161.   R or r  - restriction criteria
  162.   D or d  - a data field
  163.   S or s  - a space setting
  164.   T or t  - a tab setting
  165.   M or m  - lines after which to insert a "%MORE%"
  166.   X or x  - special options
  167.  
  168. Anything else in column 1 will cause the rest of the line to be ignored:
  169. this is a good way of adding comments. To cover future expansion, I'd
  170. advise using a ";", as that will be reserved for comments in all future
  171. versions for comment lines (anything else could get used for something!)
  172.  
  173. Column 2 onwards holds the data. The line of data is ended by a <cr>
  174. (chr(13)). To make things predictable, all TRAILING spaces are removed (use
  175. the "S" or "T" command to include spaces at the end of the data)
  176.  
  177. Apart from the headers and comments, you may have upto 200 "items". These
  178. will display in the order they appear in the config file.
  179.  
  180.  
  181. Userlog, Output and Log files:
  182. ------------------------------
  183. These three line types define where your userlog, output, and error log
  184. files are. If you are silly enough to duplicate either of these, then the
  185. last one will be used. Each path/filename may be upto 50 characters long.
  186.  
  187. If the userlog file can not be found, the program will abort.
  188.  
  189. The output file will simply overwrite any existing file.
  190.  
  191. The log file will simply append to any existing file: at a minimum, the log
  192. will list the date / time of the run, and the config files used. The log
  193. file is not opened until the config file has been read (as that is where
  194. the error log's name is defined), so errors in the config file which cause
  195. a program abort will not be logged (if this becomes a big problem, let me
  196. know, and I'll work out a way around it).
  197.  
  198. You would normally put these as the first three lines of your config file.
  199.  
  200.  
  201. File Header lines:
  202. ------------------
  203. You can have up to 10 file header lines, each limited to being 120
  204. characters long. They are simply copied verbatim to the beginning of the
  205. output file in the order they appear in the config file.
  206.  
  207. Whilst they need not be in a block at the top of the file, you'll probably
  208. find it easier if they are!
  209.  
  210. You can include ANY substitution parameters you like: as they will be
  211. copied verbatim, they will be "expanded" when the output file is displayed
  212. by TBBS. This could be a nice place to put a "clear-screen" or to put the
  213. time / date.
  214.  
  215.  
  216. Page Header lines:
  217. ------------------
  218. This text gets put at the top of every *new* page... in other words, it is
  219. the line or lines of text that follow the %MORE% command. It does NOT get
  220. put at the top of the first page, so you'll need to specifically duplicate
  221. any text you want in the HEADER fields.
  222.  
  223. As the program is simple, you COULD end up with just the page heading on
  224. the last page!
  225.  
  226. You might want to include a "clear screen" in this.... if so, put it on the
  227. first line (pretty obvious, I realise), as there is no special handling of
  228. page length (for the %more% insertion) if you DO include the clear-screen.
  229.  
  230. You can include what you like in these lines: it is interpreted just like
  231. the File Header lines. You may have up to 5 of these lines, each of up to
  232. 120 chars.
  233.  
  234.  
  235. Page Bottom lines:
  236. ------------------
  237. This text gets put at the bottom of every page... in other words, it is
  238. the line or lines of text that immediately precede the %MORE% command. You
  239. might want to use this for a dashed line, or maybe to insert a special
  240. message.
  241.  
  242. You can include what you like in these lines: it is interpreted just like
  243. the File/Page Header lines. You may have up to 5 of these lines, each of up
  244. to 120 chars.
  245.  
  246.  
  247. Restriction Criteria
  248. --------------------
  249. The restriction criteria allows you to output just a selected subset of
  250. your userlog, based on specified user settings (eg priv level, A flags...)
  251.  
  252. If you don't specify any restrictions, ALL entries in the userlog will be
  253. listed.
  254.  
  255. There are two types of "matching" in the restrictions, numerical value, and
  256. flag(s):
  257.  
  258. a) Numerical value
  259.    The format of this command is "r[name]['>' or '=' or '<'][0-255]". For
  260.  example, to list users whose priv is under 100 you would use "rpriv<100".
  261.  
  262. b) Flag(s)
  263.    The format of this command is "r[name]=[flag(s)]". Where [flags(s)] are
  264.  either 'X' (or 'x', = set) or '.' (= reset) or '-' (don't care).
  265.    Depending on the actual command, there may only be a single flag (eg
  266.  "rinvisible=X") or 8 flags (eg "rA1=XXXX....").
  267.    Note that *ALL* bits of the flag must be defined (ie all 8 for an
  268.  a-flag).
  269.  
  270. If you duplicate a restriction type (eg two "RPRIV" lines) the last one
  271. only will be used.
  272.  
  273. If more than one (different) restriction is specified, then ALL conditions
  274. must be met for inclusion on the listing.
  275.  
  276. A full list of the supported restriction fields will be found in
  277. "_RESTRIC.TXT"
  278.  
  279.  
  280.  
  281. Data fields:
  282. ------------
  283. Visible fields can contain fixed data (eg "Name: "), substituted data (eg
  284. "%FIRST%", or colourisation data (eg "%X0F%"). The program ignores the
  285. "size" of any %Xnn% colourisation commands (as they are not actually
  286. displayed), so that tab parameters etc will be in the correct locations
  287. when displayed online (as an added bonus, any %Xnn% colourisation commands
  288. within the user data will also be respected).
  289.  
  290. The substitution codes supported are generally the same as those listed in
  291. the TBBS 2.3 manual / TBBS 2.3 ULEDIT.DOC file. However, certain fields,
  292. don't really make sense (eg %TIME%) in a list like this, so they are not
  293. included.
  294.  
  295. (my TBBS manual shows the full list on pages 2-15 thru 2-17)
  296.  
  297. You may include spaces within the string of data, but all trailing spaces
  298. will be removed (that way things are 100% predictable, and you won't get
  299. caught out!)
  300.  
  301. Each data field definition is limited to 50 characters: if you need a
  302. longer field, use multiple fields!
  303.  
  304. Note: whilst you can include escape sequences in the data fields, this
  305. program will treat them like normal "visible" data: this means that not
  306. only will they will (wrongly) count towards the line length (making tab
  307. positions incorrect), they will also be deleted - perhaps only partially -
  308. when truncating a line for tabbing. I therefore suggest that you DO NOT USE
  309. ANSI ESCAPE SEQUENCES, but use the %Xnn% sequences instead.
  310.  
  311. A full list of the supported substitution codes will be found in
  312. "_PARAMS.TXT"
  313.  
  314.  
  315. Space fields:
  316. -------------
  317. Just follow the "s" by the number of spaces you want... as data fields
  318. can't have any trailing spaces, you can use this to add them!
  319.  
  320. Valid range is 1 to 255.
  321.  
  322.  
  323. Tab fields:
  324. -----------
  325. Follow the "t" by the desired column. The way this works is that the
  326. "string so far" will be trimmed, and spacea added as needed, so that the
  327. next character will be in the specified column.
  328.  
  329. If you want to make the trimmed data have a space before the next data,
  330. then either use another "tab" field, or a "space" field straight after.
  331.  
  332. (eg: data so far on the line fills 43 chars. You wish to truncate this to
  333. 30 with a"t30" command: if you do that, there will be no space between the
  334. existing data, and the new field at the 30th column. To get a space in
  335. column 29 [so that there is a definte column break], tab to 29, then either
  336. now tab to 30, or insert a single space)
  337.  
  338. Tab fields will safely ignore any %Xnn% fields when it truncates lines.
  339.  
  340. Valid range is 1 to 255.
  341.  
  342.  
  343. More field:
  344. -----------
  345. Rather than the list being one long list, you might prefer to automatically
  346. insert a "%MORE%" every X lines... the number following the "m" is the
  347. number of "lines per screen" you want displaying.... so if you make this =
  348. 23, then the %MORE% will appear on the 23rd line.
  349.  
  350. The "page bottoms" are inserted prior to this line, and "page header" lines
  351. are added after this line.
  352.  
  353. Valid range is 1 to 255.
  354.  
  355.  
  356. Special Options
  357. ---------------
  358. This is my way of picking up any odd things. The second character defines
  359. WHICH special option it is.
  360.  
  361. "X1" defines the two characters used to replace the starting & ending "%"
  362. signs on any %xxxx% fields (not including %Xnn%, which are not affected)
  363. found in the userlog data - for example, some sysops use the location field
  364. for a user's "tag-line", which can contain things like "%Location%".
  365.  
  366. If we left these as they are, then they would be substituted at run-time,
  367. and we would find that our lovely tabs are all wrong!
  368.  
  369. To get around this, Log Lister simply changes the % signs! A setting of
  370. "X1<>" would make a "%location%" in a user's data become "<location>".
  371.  
  372. If you WANT to leave the "%" symbols there, then just use "X1%%".......
  373.  
  374.  
  375. Other Special Options may be defined in the future.
  376.  
  377.  
  378. Other
  379. -----
  380. The overall line length of the output data is limited to 255 characters. If
  381. it gets longer, then it will simply truncate.
  382.  
  383.  
  384.  
  385. %zzzzz% Field Formatting
  386. ========================
  387.  
  388. Log Lister allows you to optionally include field formatting information in
  389. the %zzzzz% commands used on data lines. The syntax is (I hope) exactly the
  390. same as used in the ULEDIT printing template files.
  391.  
  392. Normally, a parameter looks like %zzzzz% (eg %NAME%), which will simply add
  393. that data to the print-line.
  394.  
  395. However, by adding in a ":" followed by further information, you can (a)
  396. set the length of that printed data (which either trims it, or pads it
  397. out); (b) left or right justify the data; (c) choose whether to use either
  398. spaces or zeros to pad the data.
  399.  
  400. The syntax is quite simple:
  401.  
  402.     %zzzzz[:[+|-]nnn[U|L|C]]%
  403.  
  404. where:  zzzzz is the "substitution" code
  405.         nnn   is a numerical value, range 1 to 255.
  406.  
  407. The formatting information starts with the ":". This may then be followed
  408. by nnn to define the string size (eg ":25"): this will either TRIM the data
  409. to nnn chars (if > nnn chars), or will LEFT justify the data in a nnn
  410. character string. This is also equivalent to prefixing the string size with
  411. a "-" (eg ":-25").
  412.  
  413. If you prefix the string size with a "+" (eg "+25"), then the data will be
  414. RIGHT justified.
  415.  
  416. (If you don't include a number, then the field will be left the same size
  417. as it was)
  418.  
  419. Normally, the resulting string will be padded with spaces (great for
  420. textual fields), but if you start nnn with a "0" (eg "017" instead of just
  421. "17"), then the string gets padded with "0"s instead (great for numerical
  422. fields).
  423.  
  424. If you end the formatting with U, L or C, then that will change the "case"
  425. of the text. "U" will give you the data in *UPPER CASE*, "L" will give you
  426. *lower case*, whilst "C" will give you *Mixed Case*.
  427.  
  428. Let's look at a few of examples... we'll assume that %NAME% is "PAUL
  429. BLITZ", and that %BYTES24% is 12345:
  430.  
  431.                               123456789012345    <<<--- ruler
  432.            %NAME:+15C%    is "     Paul Blitz"
  433.            %NAME:-15L%    is "paul blitz     "
  434.            %NAME:C%       is "Paul Blitz"
  435.            %BYTES24:+07%  is "0012345"
  436.            %BYTES24:-7%   is "12345  "
  437. silly examples:
  438.            %NAME:+015U%   is "00000PAUL BLITZ"
  439.            %BYTES24:-07%  is "1234500"
  440.  
  441.  
  442. The formatting commands can be used with ANY visible %xxx% substitution,
  443. and will override any case-specifics that the %xxx% may otherwise have.
  444.  
  445. Watch out for unexpected things.... flag fields, normally "X..XXX..." will
  446. become "x..xxx...".
  447.  
  448.  
  449. Thanks...
  450. =========
  451.  
  452. Thanks to lots of people:
  453.  
  454. .... to Michael Muller for coming up with the original idea (which expanded
  455. a bit from his original ideas!), and for beta testing the program. Also to
  456. Robert Gagliano, who also beta tested.
  457.  
  458. .... to the eSoft crew for not only creating TBBS, but for answering a few
  459. questions along the way to help me write the program.
  460.  
  461. .... to Scott Sturgis at Zone One for distributing the program in the US,
  462. and giving encouragement (and maybe some $$$ if you all register!!)
  463.  
  464. .... to Borland for creating Turbo Pascal (version 4) which all my programs
  465. are written in.
  466.  
  467. .... to my family, who allow me to sit in my "computer room" writing email
  468. to all you strange people in the US (I met many of you at ONEBBSCON '95, so
  469. I KNOW how strange you are<g>), as well as programming.
  470.  
  471. .... to God, for creating me, and giving me the skills he has done!
  472.  
  473.  
  474. Demonstration Version
  475. =====================
  476.  
  477. This DEMONSTRATION VERSION of the Log Lister program is a fully functional
  478. program, with *two* single exceptions: First, this version of the program
  479. will only print out from the first 30 records of your TBBS userlog (your
  480. listing may contain fewer lines of output if you use the restriction
  481. commands). That should be more than enough to let you decide whether the
  482. fully registered version of the program will be of use to you. Second, the
  483. top of your output file will have a "nag line" or three added.... even more
  484. reason to buy the proper program!
  485.  
  486. See below for how to buy the full version.
  487.  
  488.  
  489. Copyright etc:
  490. ==============
  491.  
  492. This program is the copyright of Paul Blitz, 1995/6.
  493.  
  494. This demonstration version of the program may be freely used to help you
  495. decide whether the full version will be of use to you. It may be freely
  496. distributed, by any means (including via a BBS, on a CD etc) to all others,
  497. on the simple condition that ALL files included in this archive are
  498. included. Feel free to re-archive it using a different archiver.
  499.  
  500. Whilst I believe that this program works correctly, I do not GUARANTEE it.
  501. All that I WILL guarantee is that it will take up space on your disk drive,
  502. and that running the program may well cause it's output to take up even
  503. more space!
  504.  
  505. It is up to *you* to decide that the program does what you want: I can not
  506. be held responsible for any damage caused by this program to your computer,
  507. the files on your computer, NOR for any other "knock-on" effects / damage
  508. caused (eg loss of business), etc.
  509.  
  510. *************************************************************************
  511. The FULL version of this product may NOT be copied, other than for taking
  512. suitable security backups.
  513. *************************************************************************
  514.  
  515.  
  516. Purchasing the fully-working version
  517. ====================================
  518.  
  519.  
  520. The fully registered version of LOGLIST is available exclusively from:
  521.  
  522.  
  523. Paul Blitz,                            paul.blitz@enterprise.net
  524. 25, Woodgreen Road,
  525. Harestock,
  526. Winchester,
  527. Hants,
  528. SO22 6LZ.
  529.  
  530. OR
  531.  
  532. zone one                               zoneone@primenet.com
  533. 8424A Santa Monica Blvd #200
  534. West Hollywood, CA. 90069
  535.  
  536. Vox: 213.653.6450
  537.  
  538.  
  539. (Please refer to the BUY_ME.TXT file for pricing details.)
  540.  
  541.  
  542. If you have any bright suggestions, then feel free to write to me, or
  543. contact me by phone at home (between 20:00 and 22:00 (UK time) ONLY please)
  544. on +44 1962-885696.
  545.  
  546. You may call my BBS: "The Cardboard Box BBS" on +44 1962-880278 (for those
  547. of you in the UK, who don't understand international dialling, call 01962
  548. 880278).
  549.  
  550. You can send email to me at Fidonet 2:252/201, Chatnet 44:2520/201, or
  551. Internet "paul.blitz@enterprise.net", or on the eSoft BBS.
  552.  
  553.  
  554.  
  555.